package com.huiyun.project.pay.client.feign;

import com.huiyun.project.common.core.constant.SecurityConstants;
import com.huiyun.project.common.core.constant.ServiceNameConstants;
import com.huiyun.project.common.core.domain.R;
import com.huiyun.project.pay.client.vo.PayReq;
import com.huiyun.project.pay.client.vo.RefundReq;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * 支付接口
 *
 * @author Administrator
 */
@FeignClient(contextId = "remotePayService", value = ServiceNameConstants.PAY_SERVICE)
public interface RemotePayService {
    /**
     * 微信支付创建
     *
     * @param payReq
     * @param from
     * @return
     */
    @PostMapping("/wxPay/payOrder/create")
    R<String> wxPayOrderCreate(@RequestBody PayReq payReq, @RequestHeader(SecurityConstants.FROM) String from);

    /**
     * 支付宝支付订单创建
     *
     * @param payReq
     * @param from
     * @return
     */
    @PostMapping("/aliPay/payOrder/create")
    R<String> aliPayOrderCreate(@RequestBody PayReq payReq, @RequestHeader(SecurityConstants.FROM) String from);







    /**
     * 支付订单创建
     *
     * @param payReq
     * @param from
     * @return
     */
    @PostMapping("/pay/payOrder/create")
    R<String> payOrderCreate(@RequestBody PayReq payReq, @RequestHeader(SecurityConstants.FROM) String from);

    /**
     * 支付订单退款
     *
     * @param refundReq
     * @param from
     * @return
     */
    @PostMapping("/pay/refund")
    R<String> refund(@RequestBody RefundReq refundReq, @RequestHeader(SecurityConstants.FROM) String from);

}
